int
-xc_csched_domain_set(
+xc_sched_credit_domain_set(
int xc_handle,
uint32_t domid,
- struct csched_domain *sdom)
+ struct sched_credit_adjdom *sdom)
{
DECLARE_DOM0_OP;
}
int
-xc_csched_domain_get(
+xc_sched_credit_domain_get(
int xc_handle,
uint32_t domid,
- struct csched_domain *sdom)
+ struct sched_credit_adjdom *sdom)
{
DECLARE_DOM0_OP;
int err;
uint64_t *latency, uint16_t *extratime,
uint16_t *weight);
-int xc_csched_domain_set(int xc_handle,
- uint32_t domid,
- struct csched_domain *sdom);
+int xc_sched_credit_domain_set(int xc_handle,
+ uint32_t domid,
+ struct sched_credit_adjdom *sdom);
-int xc_csched_domain_get(int xc_handle,
- uint32_t domid,
- struct csched_domain *sdom);
+int xc_sched_credit_domain_get(int xc_handle,
+ uint32_t domid,
+ struct sched_credit_adjdom *sdom);
typedef evtchn_status_t xc_evtchn_status_t;
"weight", weight);
}
-static PyObject *pyxc_csched_domain_set(XcObject *self,
- PyObject *args,
- PyObject *kwds)
+static PyObject *pyxc_sched_credit_domain_set(XcObject *self,
+ PyObject *args,
+ PyObject *kwds)
{
uint32_t domid;
uint16_t weight;
uint16_t cap;
static char *kwd_list[] = { "dom", "weight", "cap", NULL };
static char kwd_type[] = "I|HH";
- struct csched_domain sdom;
+ struct sched_credit_adjdom sdom;
weight = 0;
cap = (uint16_t)~0U;
sdom.weight = weight;
sdom.cap = cap;
- if ( xc_csched_domain_set(self->xc_handle, domid, &sdom) != 0 )
+ if ( xc_sched_credit_domain_set(self->xc_handle, domid, &sdom) != 0 )
return PyErr_SetFromErrno(xc_error);
Py_INCREF(zero);
return zero;
}
-static PyObject *pyxc_csched_domain_get(XcObject *self, PyObject *args)
+static PyObject *pyxc_sched_credit_domain_get(XcObject *self, PyObject *args)
{
uint32_t domid;
- struct csched_domain sdom;
+ struct sched_credit_adjdom sdom;
if( !PyArg_ParseTuple(args, "I", &domid) )
return NULL;
- if ( xc_csched_domain_get(self->xc_handle, domid, &sdom) != 0 )
+ if ( xc_sched_credit_domain_get(self->xc_handle, domid, &sdom) != 0 )
return PyErr_SetFromErrno(xc_error);
return Py_BuildValue("{s:H,s:H}",
" latency [long]: domain's wakeup latency hint\n"
" extratime [int]: domain aware of extratime?\n"},
- { "csched_domain_set",
- (PyCFunction)pyxc_csched_domain_set,
+ { "sched_credit_domain_set",
+ (PyCFunction)pyxc_sched_credit_domain_set,
METH_KEYWORDS, "\n"
"Set the scheduling parameters for a domain when running with the\n"
"SMP credit scheduler.\n"
" weight [short]: domain's scheduling weight\n"
"Returns: [int] 0 on success; -1 on error.\n" },
- { "csched_domain_get",
- (PyCFunction)pyxc_csched_domain_get,
+ { "sched_credit_domain_get",
+ (PyCFunction)pyxc_sched_credit_domain_get,
METH_VARARGS, "\n"
"Get the scheduling parameters for a domain when running with the\n"
"SMP credit scheduler.\n"
except Exception, ex:
raise XendError(str(ex))
- def domain_csched_get(self, domid):
+ def domain_sched_credit_get(self, domid):
"""Get credit scheduler parameters for a domain.
"""
dominfo = self.domain_lookup_by_name_or_id_nr(domid)
if not dominfo:
raise XendInvalidDomain(str(domid))
try:
- return xc.csched_domain_get(dominfo.getDomid())
+ return xc.sched_credit_domain_get(dominfo.getDomid())
except Exception, ex:
raise XendError(str(ex))
- def domain_csched_set(self, domid, weight, cap):
+ def domain_sched_credit_set(self, domid, weight, cap):
"""Set credit scheduler parameters for a domain.
"""
dominfo = self.domain_lookup_by_name_or_id_nr(domid)
if not dominfo:
raise XendInvalidDomain(str(domid))
try:
- return xc.csched_domain_set(dominfo.getDomid(), weight, cap)
+ return xc.sched_credit_domain_set(dominfo.getDomid(), weight, cap)
except Exception, ex:
raise XendError(str(ex))
val = fn(req.args, {'dom': self.dom.domid})
return val
- def op_domain_csched_get(self, _, req):
- fn = FormFn(self.xd.domain_csched_get,
+ def op_domain_sched_credit_get(self, _, req):
+ fn = FormFn(self.xd.domain_sched_credit_get,
[['dom', 'int']])
val = fn(req.args, {'dom': self.dom.domid})
return val
- def op_domain_csched_set(self, _, req):
- fn = FormFn(self.xd.domain_csched_set,
+ def op_domain_sched_credit_set(self, _, req):
+ fn = FormFn(self.xd.domain_sched_credit_set,
[['dom', 'int'],
['weight', 'int']])
val = fn(req.args, {'dom': self.dom.domid})
specifies another way of setting a domain's\n\
cpu period/slice."
-csched_help = "csched Set or get credit scheduler parameters"
+sched_credit_help = "sched-credit Set or get credit scheduler parameters"
block_attach_help = """block-attach <DomId> <BackDev> <FrontDev> <Mode>
[BackDomId] Create a new virtual block device"""
block_detach_help = """block-detach <DomId> <DevId> Destroy a domain's virtual block device,
]
scheduler_commands = [
- "csched",
+ "sched-credit",
"sched-bvt",
"sched-bvt-ctxallow",
"sched-sedf",
else:
print_sedf(sedf_info)
-def xm_csched(args):
- usage_msg = """Csched: Set or get credit scheduler parameters
+def xm_sched_credit(args):
+ usage_msg = """sched-credit: Set or get credit scheduler parameters
Usage:
- csched -d domain [-w weight] [-c cap]
+ sched-credit -d domain [-w weight] [-c cap]
"""
try:
opts, args = getopt.getopt(args[0:], "d:w:c:",
sys.exit(1)
if weight is None and cap is None:
- print server.xend.domain.csched_get(domain)
+ print server.xend.domain.sched_credit_get(domain)
else:
if weight is None:
weight = int(0)
if cap is None:
cap = int(~0)
- err = server.xend.domain.csched_set(domain, weight, cap)
+ err = server.xend.domain.sched_credit_set(domain, weight, cap)
if err != 0:
print err
"sched-bvt": xm_sched_bvt,
"sched-bvt-ctxallow": xm_sched_bvt_ctxallow,
"sched-sedf": xm_sched_sedf,
- "csched": xm_csched,
+ "sched-credit": xm_sched_credit,
# block
"block-attach": xm_block_attach,
"block-detach": xm_block_detach,
uint32_t extratime;
uint32_t weight;
} sedf;
- struct csched_domain {
+ struct sched_credit_adjdom {
uint16_t weight;
uint16_t cap;
} credit;